# Contributor: Grigory Kirillov <txgk@bk.ru>
# Maintainer:
pkgname=libmpfi
pkgver=1.5.4
pkgrel=2
pkgdesc="Library for multiple precision interval arithmetic"
url="https://github.com/arpra-project/mpfi"
arch="all"
license="GPL-3.0-only OR LGPL-3.0-only"
makedepends="
	autoconf
	automake
	gmp-dev
	libtool
	mpfr-dev
	"
options="!check" # tests are broken
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="https://github.com/arpra-project/mpfi/archive/$pkgver/mpfi-$pkgver.tar.gz
	gcc14-bad-ref.patch
	gcc14-mismatched-type.patch
	"
builddir="$srcdir/mpfi-$pkgver"

prepare() {
	default_prepare
	autoreconf -fi
}

build() {
	export CFLAGS="${CFLAGS/-Os/-O3}" # gotta go fast

	./configure \
		--target="$CTARGET" \
		--build="$CBUILD" \
		--host="$CHOST" \
		--prefix=/usr
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
3e2df2243f40b20d49b6698db534c668be583eaa5c75d37b70a2e6e5be2c0fcc303df1b991b8e427dca78eca5eb2aef120ea75cefe1587c13a71996e1190ff5d  mpfi-1.5.4.tar.gz
b5daf804c828ddf6ca37abee9a4cc336027e17eeaea84f16043c306ba4f9727fe529f96e661ee3c81eb3440234d0600f6f418525b6e01d6f753aea8a1c43c07a  gcc14-bad-ref.patch
b6ba3e4f72b1daa3b21fa0210bb3b7dd9bae5fcc55e81994785fad43c6e072632f598134547cb8855472d16329686c4187c72d7d03091a6f7459583f3ba2ad5d  gcc14-mismatched-type.patch
"
